
namespace Stee.CAP8.Communication.ServiceSample
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using Grpc.Core;
    using Microsoft.AspNetCore.Authentication;
    using Microsoft.Extensions.Logging;
    public class GreeterService : Greeter.GreeterBase
    {
        private readonly ILogger<GreeterService> _logger;
        public GreeterService(ILogger<GreeterService> logger)
        {
            _logger = logger;
        }

        public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context)
        {
            return Task.FromResult(new HelloReply
            {
                ID = request.ID + 1,
                Message = "Hello " + request.Name
            }); ;
        }

        public override Task<Person> GetPersonInfo(EmptyMessage request, ServerCallContext context)
        {
            //var token = context.GetHttpContext().GetTokenAsync("Bearer").Result;
 
            return Task.FromResult(new Person() { Name = "develoer and tester", Sex = Person.Types.Gender.Male });
        }
    }
}
